/**
 * 
 */
package com.transer.web.action.signup;

import com.opensymphony.xwork2.ActionSupport;
import com.transer.console.ConsoleConstants;
import com.transer.constant.Constants;
import com.transer.job.AddUserJob;
import com.transer.utils.JobQueueOB;
import com.transer.utils.MD5;

/**
 * 
 * class defination are there
 * 
 * @author Administrator
 * 
 * @version 1.0 ywengineer@gmail.com
 * 
 */
public class PublisherRegisteAction extends RegisteAction {

	private static final long serialVersionUID = 5515990599207197249L;

	@Override
	public String execute() throws Exception {
		super.execute();
		// 存在验证错误
		if (hasFieldErrors()) {
			return ActionSupport.INPUT;
		}
		// 工作发布方
		user.setType(Constants.USER_TYPE_PUBLISHER);
		// 加密
		user.setPassword(MD5.getMD5(user.getPassword()));
		// 添加发送邮件
		JobQueueOB.getInstance().addJob(ConsoleConstants.QUEUE_INDEX_SAVE_USER, new AddUserJob(userDao, user));
		// 注册成功
		return ActionSupport.SUCCESS;
	}
}